<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}</title>

    <!--Boot strap
    {#    <link rel="stylesheet" href="{% static "css/bootstrap.css" %}">#}
    {#    <script src="{% static "js/jquery-3.1.1.js" %}"></script>#}
    {#    <script src="{% static "js/bootstrap.js" %}"></script>#}
    -->
    <link href="/static/css/bootstrap.css" rel="stylesheet">
    <link href="/static/css/login.css" rel="stylesheet">
    <script src="/static/js/jquery-3.2.1.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>

    {#  单个样式添加#}
    {% block head %}{% endblock %}
</head>
<body>
    <div class="container" style="width:99%">
        <!-- 导航栏 -->
        <div class="navbar navbar-inverse" role="navigation">
            <div class="navbar-header">
                <a href="#" class="navbar-brand">主机管理</a>
            </div>

            <div class="collapse navbar-collapse">
                {% if request.session.UserName %}
                    <ul class="nav navbar-nav">
                        <li {% if request.path == '/hosts/index/' %} class="active" {% endif %}>
                            <a href="/hosts/index/">Home</a>
                        </li>
                        <li><a href="#">关于我们</a></li>
                    </ul>
                    <ul class="nav navbar-nav navbar-right" style="padding-right: 1%">
                        <li class="dropdown">
                            <a href="" class="dropdown-toggle" data-toggle="dropdown">
                                <span class="glyphicon glyphicon-user"></span> {{ request.session.UserName }}
                                <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li><a href='#' >修改密码</a></li>
                                <li class="divider"></li>
                                <li><a href={% url "Logout" %}>注销登陆</a></li>
                            </ul>
                        </li>
                    </ul>
                {% else %}
                    <ul class="nav navbar-nav">
                        <li><a href="#">关于我们</a></li>
                    </ul>
                    <ul class="nav navbar-nav" style="padding-right: 1%">
                        <li  class="active"><a href={% url 'Login' %}>登陆</a></li>
                    </ul>
                    <ul class="nav navbar-nav navbar-right" style="padding-right: 1%">
                        <li class="active"><a href="#">帮助</a></li>
                    </ul>
                {% endif %}
            </div>
        </div>
    </div>

    <!--内容区-->
    {% block content %}{% endblock %}

    <!-- 页脚 -->
    <div class="col-md-12">
        <hr />
        <p class="text-muted">&copy; System 2017</p>
    </div>
</body>
</html>